﻿@{
    Layout = null;
}
@*产品调拨*@
<script src="~/Scripts/MGJJS/FleeGoods/ProductAllot.js"></script>
<link href="~/Scripts/Bootstrap/css/bootstrap-datepicker3.min.css" rel="stylesheet" />
<script src="~/Scripts/Bootstrap/js/bootstrap-datepicker.js"></script>
<script src="~/Scripts/MGJJS/FleeGoods/CommonBox.js"></script>
<div class="mtlr15">
    <form id="SearchForm" role="form" onkeydown="if(event.keyCode==13){return false;}">
        <div class="row">
            <div class="col-lg-7 col-md-7 col-sm-7" style="padding:0">
                <button type="button" class="btn btn-success" onclick="$.MGJ.ProductAllot.Dialog_AllotInfo()">
                    <i class="glyphicon glyphicon-plus-sign"></i>
                    产品调拨
                </button>
                @*<button type="button" class="btn btn-success">
                        <i class="glyphicon glyphicon-arrow-down"></i>
                        导出
                    </button>*@
            </div>
            <div class="col-lg-5 col-md-5 col-sm-5">
                <div class="input-group">
                    <div style="width:100%;display:none"></div>
                    <input id="Key" type="text" name="Key" class="form-control" placeholder="物流码" onkeydown="if (event.keyCode == 13) { $.MGJ.ProductAllot.Ajax_AllotPageList(1); }">
                    <span class="input-group-addon" onclick="$.MGJ.ProductAllot.Ajax_AllotPageList(1);">
                        <span class=" glyphicon glyphicon-search"></span>
                    </span>
                    <div class="input-group-btn" style="margin-left:1px;" onclick="detailSearch(this)">
                        <button type="button" class="btn btn-default" style="border: 1px solid transparent;">
                            更多搜索
                            <span class="caret"></span>
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <div class="detail-search-con" style="display:none">
            <div class="row newrow">
                <div class="col-lg-1 col-md-1 col-sm-1 col-lg-offset-1 col-md-offset-1 col-sm-offset-1 text-right" style="padding:0">
                    开始时间
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2">
                    <input id="StartDate" type="text" name="StartDate" class="form-control" placeholder="开始时间" />
                </div>
                <div class="col-lg-1 col-md-1 col-sm-1 col-sm-2 text-right" style="padding:0">
                    结束时间
                </div>

                <div class="col-lg-2 col-md-2 col-sm-2 col-sm-3">
                    <input id="EndDate" type="text" name="EndDate" class="form-control" placeholder="结束时间" />
                </div>
                <div class="col-lg-1 col-md-1 col-sm-1 text-right" style="padding:0">
                    物流码
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2 col-sm-3">
                    <input type="text" name="Code" class="form-control" placeholder="物流码" />
                </div>
            </div>
            <div class="row newrow">
                <div class="col-lg-1 col-md-1 col-sm-1 col-lg-offset-1 col-md-offset-1 col-sm-offset-1 text-right" style="padding:0">
                    产品名称
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2">
                    <input type="text" name="ProductName" class="form-control" placeholder="产品名称" />
                </div>
                <div class="col-lg-1 col-md-1 col-sm-1 col-sm-2 text-right" style="padding:0">
                    调出仓库
                </div>

                <div class="col-lg-2 col-md-2 col-sm-2 col-sm-2">
                    <input type="text" name="FromWarehouseName" class="form-control" placeholder="调出仓库" />
                </div>
                <div class="col-lg-1 col-md-1 col-sm-1 text-right" style="padding:0">
                    调入仓库
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2 col-sm-2">
                    <input type="text" name="GoWarehouseName" class="form-control" placeholder="调入仓库" />
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2 col-sm-2 text-center">
                    <button type="button" class="btn btn-default" style="margin-left:23px;" onclick="$.MGJ.ProductAllot.Ajax_AllotPageList(1);">
                        <span class="glyphicon glyphicon-search"></span>
                        搜索
                    </button>
                    <button type="reset" class="btn btn-default">
                        重置
                    </button>
                </div>
            </div>
        </div>
    </form>
    <div id="wh100">
        <div class="fixed-table">
            <div id="over">
                <div class="fixed-table-middle" style="width:100%;">
                    <table style="width:100%;">
                        <thead>
                            <tr>
                                @*<th width="15"><input type="checkbox" class="AllClickCheckbox"></th>*@
                                <th>所属机构</th>
                                <th>调拨编码</th>
                                <th>产品名称</th>
                                <th>产品编码</th>
                                <th>调拨数量</th>
                                <th>调出仓库</th>
                                <th>调入仓库</th>
                                <th>物流码等级</th>
                                <th>导入状态</th>
                                <th>货品仓位</th>
                                <th>操作人</th>
                                <th>操作时间</th>
                                <th>备注</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody id="tableList" style="display:none;" binding="{'pageId':'ShoppingPager','pageCallback':'$.MGJ.ProductAllot.Ajax_AllotPageList','emptyHtml':OMID_EmptyHtml}">
                            <tr>
                                @*<td width="15"><input type="checkbox" class="AllClickChild"></td>*@
                                <td binding="{'text':'EnterpriseName'}"> </td>
                                <td binding="{'text':'FormCode'}"></td>
                                <td binding="{'text':'ProductName'}"></td>
                                <td binding="{'text':'ProductCode'}"></td>
                                <td binding="{'text':'Num'}"></td>
                                <td binding="{'text':'FromWarehouseName'}"></td>
                                <td binding="{'text':'GoWarehouseName'}"></td>
                                <td binding="{'text':'Levv'}"></td>
                                <td class="StatusText" binding="{'text':'statusText'}"> </td>
                                <td binding="{'text':'Location'}"></td>
                                <td binding="{'text':'CreateLoginName'}"></td>
                                <td binding="{'text':'CreateDate','textHandle':'datetime'}"></td>
                                <td style="max-width:100px" binding="{'text':'Remark','title':'Remark'}"></td>
                                <td>
                                    <a>编辑</a>
                                    @*<a>删除</a>*@
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="fixed-table-right">
                    <table>
                        <thead>
                            <tr>
                                <th style="height:36px;">操作</th>
                            </tr>
                        </thead>
                        <tbody id="tableList_right" style="display:none;" binding="{'pageId':'ShoppingPager','pageCallback':'$.MGJ.ProductAllot.Ajax_AllotPageList'}">
                            <tr>
                                <td style="height:36px;">
                                    <a binding="{'ID':'ID'}" href="javascript:;" class="limitUpd  IfTextBtn" onclick="$.MGJ.ProductAllot.Dialog_EditAllot(this)">编辑</a>
                                    <a binding="{'FilePath':'FilePath'}" onclick="$.MGJ.CommonBox.Dialog_CommonBox(this)">查看物流码</a>

                                     @*<a binding="{'ID':'ID'}" href="javascript:;" class="limitUpd" onclick="$.MGJ.ProductAllot.Ajax_Del(this)">删除</a>*@
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div id="ShoppingPager"></div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $("#StartDate").datepicker({
        format: "yyyy-mm-dd",
        language: 'cn',
        todayBtn: "linked",
        autoclose: true,
        todayHighlight: true,
        endDate: new Date()
    }).on('changeDate', function (e) {
        var startTime = e.date;
        $('#EndDate').datepicker('setStartDate', startTime);
    });
    $("#EndDate").datepicker({
        format: "yyyy-mm-dd",
        language: 'cn',
        todayBtn: "linked",
        autoclose: true,
        todayHighlight: true,
        endDate: new Date()
    }).on('changeDate', function (e) {
        var endTime = e.date;
        $('#StartDate').datepicker('setEndDate', endTime);
    });

    var ColspanNub = $(".fixed-table-middle").find("tr").children("td").length
    window.OMID_EmptyHtml = '<tr><td colspan="' + ColspanNub + '"><p class="no-result">无符合条件的数据结果</p></td></tr>';

    $(function () {
        $.MGJ.ProductAllot.Ajax_AllotPageList(1);
    });

    $('#SearchForm').bootstrapValidator({
        fields: {
            Code: {
                validators: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9]+$/,
                        message: '退货编码只能为字母和数字'
                    }
                }
            },
            ProductName: {
                validators: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '产品名称不能输入符号'
                    }
                }
            },
            FromWarehouseName: {
                validators: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '调出仓库不能输入符号'
                    }
                }
            },
            GoWarehouseName: {
                validators: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '调入仓库不能输入符号'
                    }
                }
            }
        }
    })
</script>




